<?php
/**
 * 声明一个空类
 * 1.new stdClass()
 * 2.(Object)[]
 */ 
$b = new stdClass();
if (isset($b)) {
    echo 'stdClass is not empty' . "\n";
}
class sms
{
    static public function sendOne($force = false)
    {
        if ($force == true) {
            $ret = array_rand([true,false]);
            if (true === $ret) {
                return true;
            } else {
                return false;
            }
        } else {
            return true;
        }
    }
}

var_dump(sms::sendOne());

//$service = new stdClass();
//$service = (Object)[];
$service = (object)null;
var_dump($service);
if (!empty($service)) {
    echo 'stdClass is not empty' . "\n";
}
if ($service) {
    echo 'stdClass is not false' . "\n";
}
